- Author:
- Soroush Safaei <ssaf006@aucklanduni.ac.nz>
- Date:
- 2017-08-15 18:22:15+12:00
- Desc:
- Adding the systemic circulation model
- Permanent Source URI:
- https://models.fieldml.org/workspace/43b/rawfile/ce87545e174bd4b8e9daf7f25f6298119f6d2220/BG Tutorial Fluid Systems/Circuation.cellml
<?xml version='1.0'?>
<model name="ModelMain" xmlns="http://www.cellml.org/cellml/1.0#" xmlns:cellml="http://www.cellml.org/cellml/1.0#">
<units name="UnitP">
<unit multiplier="133" units="pascal"/>
</units>
<units name="UnitQ">
<unit units="UnitV"/>
<unit exponent="-1" units="second"/>
</units>
<units name="UnitR">
<unit units="UnitP"/>
<unit exponent="-1" units="UnitQ"/>
</units>
<units name="UnitC">
<unit exponent="-1" units="UnitP"/>
<unit units="UnitV"/>
</units>
<units name="UnitCV">
<unit units="UnitQ"/>
<unit exponent="-0.5" units="UnitP"/>
</units>
<units name="UnitL">
<unit units="UnitP"/>
<unit exponent="-1" units="UnitQ"/>
<unit units="second"/>
</units>
<units name="UnitE">
<unit units="UnitP"/>
<unit exponent="-1" units="UnitV"/>
</units>
<units name="UnitV">
<unit multiplier="0.001" units="litre"/>
</units>
<component name="main">
<variable name="t" public_interface="out" units="second"/>
<variable initial_value="1.0" name="T" units="second"/>
<variable name="mt" units="second"/>
<variable name="et_a" units="dimensionless"/>
<variable name="et_v" units="dimensionless"/>
<variable initial_value="0.92" name="Tpwb" units="dimensionless"/>
<variable initial_value="0.09" name="Tpww" units="dimensionless"/>
<variable initial_value="0.3" name="Ts1" units="dimensionless"/>
<variable initial_value="0.45" name="Ts2" units="dimensionless"/>
<variable initial_value="400" name="CV_ti" units="UnitCV"/>
<variable initial_value="350" name="CV_pa" units="UnitCV"/>
<variable initial_value="400" name="CV_mi" units="UnitCV"/>
<variable initial_value="350" name="CV_ao" units="UnitCV"/>
<variable name="E_lv" units="UnitE"/>
<variable initial_value="2.5" name="E_lv_Max" units="UnitE"/>
<variable initial_value="0.1" name="E_lv_Min" units="UnitE"/>
<variable name="E_la" units="UnitE"/>
<variable initial_value="0.25" name="E_la_Max" units="UnitE"/>
<variable initial_value="0.15" name="E_la_Min" units="UnitE"/>
<variable name="E_rv" units="UnitE"/>
<variable initial_value="1.15" name="E_rv_Max" units="UnitE"/>
<variable initial_value="0.1" name="E_rv_Min" units="UnitE"/>
<variable name="E_ra" units="UnitE"/>
<variable initial_value="0.25" name="E_ra_Max" units="UnitE"/>
<variable initial_value="0.15" name="E_ra_Min" units="UnitE"/>
<!-- parameters systemic-->
<variable initial_value="0.003" name="R_sas" units="UnitR"/>
<variable initial_value="0.05" name="R_sat" units="UnitR"/>
<variable initial_value="0.5" name="R_sar" units="UnitR"/>
<variable initial_value="0.52" name="R_scp" units="UnitR"/>
<variable initial_value="0.075" name="R_svn" units="UnitR"/>
<variable initial_value="0.002" name="R_pas" units="UnitR"/>
<variable initial_value="0.01" name="R_pat" units="UnitR"/>
<variable initial_value="0.05" name="R_par" units="UnitR"/>
<variable initial_value="0.25" name="R_pcp" units="UnitR"/>
<variable initial_value="0.0006" name="R_pvn" units="UnitR"/>
<variable initial_value="0.000062" name="L_sas" units="UnitL"/>
<variable initial_value="0.0017" name="L_sat" units="UnitL"/>
<variable initial_value="0.000052" name="L_pas" units="UnitL"/>
<variable initial_value="0.0017" name="L_pat" units="UnitL"/>
<variable initial_value="0.08" name="C_sas" units="UnitC"/>
<variable initial_value="1.6" name="C_sat" units="UnitC"/>
<variable initial_value="20.5" name="C_svn" units="UnitC"/>
<variable initial_value="0.18" name="C_pas" units="UnitC"/>
<variable initial_value="3.8" name="C_pat" units="UnitC"/>
<variable initial_value="20.5" name="C_pvn" units="UnitC"/>
<!-- state variables-->
<variable initial_value="30" name="u_pas" units="UnitP"/>
<variable initial_value="30" name="u_pat" units="UnitP"/>
<variable initial_value="0" name="u_pvn" units="UnitP"/>
<variable initial_value="100" name="u_sas" units="UnitP"/>
<variable initial_value="100" name="u_sat" units="UnitP"/>
<variable initial_value="0" name="u_svn" units="UnitP"/>
<variable name="u_ra" units="UnitP"/>
<variable name="u_rv" units="UnitP"/>
<variable name="u_la" units="UnitP"/>
<variable name="u_lv" units="UnitP"/>
<variable initial_value="1.0" name="u_ra_ini" units="UnitP"/>
<variable initial_value="1.0" name="u_rv_ini" units="UnitP"/>
<variable initial_value="1.0" name="u_la_ini" units="UnitP"/>
<variable initial_value="1.0" name="u_lv_ini" units="UnitP"/>
<variable initial_value="0" name="v_pas" units="UnitQ"/>
<variable initial_value="0" name="v_pat" units="UnitQ"/>
<variable name="v_pvn" units="UnitQ"/>
<variable initial_value="0" name="v_sas" units="UnitQ"/>
<variable initial_value="0" name="v_sat" units="UnitQ"/>
<variable name="v_svn" units="UnitQ"/>
<variable name="v_ti" units="UnitQ"/>
<variable name="v_pa" units="UnitQ"/>
<variable name="v_mi" units="UnitQ"/>
<variable name="v_ao" units="UnitQ"/>
<variable initial_value="20" name="q_ra" units="UnitV"/>
<variable initial_value="500" name="q_rv" units="UnitV"/>
<variable initial_value="20" name="q_la" units="UnitV"/>
<variable initial_value="500" name="q_lv" units="UnitV"/>
<variable initial_value="4.0" name="q_ra_ini" units="UnitV"/>
<variable initial_value="10.0" name="q_rv_ini" units="UnitV"/>
<variable initial_value="4.0" name="q_la_ini" units="UnitV"/>
<variable initial_value="5.0" name="q_lv_ini" units="UnitV"/>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_pas</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_pa</ci>
<ci>v_pas</ci>
</apply>
<ci>C_pas</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_pat</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_pas</ci>
<ci>v_pat</ci>
</apply>
<ci>C_pat</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_pvn</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_pat</ci>
<ci>v_pvn</ci>
</apply>
<ci>C_pvn</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_sas</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_ao</ci>
<ci>v_sas</ci>
</apply>
<ci>C_sas</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_sat</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_sas</ci>
<ci>v_sat</ci>
</apply>
<ci>C_sat</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>u_svn</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<ci>v_sat</ci>
<ci>v_svn</ci>
</apply>
<ci>C_svn</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>v_pas</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<apply>
<minus/>
<ci>u_pas</ci>
<ci>u_pat</ci>
</apply>
<apply>
<times/>
<ci>v_pas</ci>
<ci>R_pas</ci>
</apply>
</apply>
<ci>L_pas</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>v_pat</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<apply>
<minus/>
<apply>
<minus/>
<apply>
<minus/>
<ci>u_pat</ci>
<ci>u_pvn</ci>
</apply>
<apply>
<times/>
<ci>v_pat</ci>
<ci>R_pat</ci>
</apply>
</apply>
<apply>
<times/>
<ci>v_pat</ci>
<ci>R_pcp</ci>
</apply>
</apply>
<apply>
<times/>
<ci>v_pat</ci>
<ci>R_par</ci>
</apply>
</apply>
<ci>L_pat</ci>
</apply>
</apply>
<apply>
<eq/>
<ci>v_pvn</ci>
<apply>
<divide/>
<apply>
<minus/>
<ci>u_pvn</ci>
<ci>u_la</ci>
</apply>
<ci>R_pvn</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>v_sas</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<apply>
<minus/>
<ci>u_sas</ci>
<ci>u_sat</ci>
</apply>
<apply>
<times/>
<ci>v_sas</ci>
<ci>R_sas</ci>
</apply>
</apply>
<ci>L_sas</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>v_sat</ci>
</apply>
<apply>
<divide/>
<apply>
<minus/>
<apply>
<minus/>
<apply>
<minus/>
<apply>
<minus/>
<ci>u_sat</ci>
<ci>u_svn</ci>
</apply>
<apply>
<times/>
<ci>v_sat</ci>
<ci>R_sat</ci>
</apply>
</apply>
<apply>
<times/>
<ci>v_sat</ci>
<ci>R_scp</ci>
</apply>
</apply>
<apply>
<times/>
<ci>v_sat</ci>
<ci>R_sar</ci>
</apply>
</apply>
<ci>L_sat</ci>
</apply>
</apply>
<apply>
<eq/>
<ci>v_svn</ci>
<apply>
<divide/>
<apply>
<minus/>
<ci>u_svn</ci>
<ci>u_ra</ci>
</apply>
<ci>R_svn</ci>
</apply>
</apply>
<apply>
<eq/>
<ci>mt</ci>
<apply>
<minus/>
<ci>t</ci>
<apply>
<times/>
<ci>T</ci>
<apply>
<floor/>
<apply>
<divide/>
<ci>t</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</apply>
</apply>
<!-- Heart Flow-->
<apply>
<eq/>
<ci>v_ti</ci>
<piecewise>
<piece>
<apply>
<times/>
<ci>CV_ti</ci>
<apply>
<root/>
<apply>
<abs/>
<apply>
<minus/>
<ci>u_ra</ci>
<ci>u_rv</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<geq/>
<ci>u_ra</ci>
<ci>u_rv</ci>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<lt/>
<ci>u_ra</ci>
<ci>u_rv</ci>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<ci>v_pa</ci>
<piecewise>
<piece>
<apply>
<times/>
<ci>CV_pa</ci>
<apply>
<root/>
<apply>
<abs/>
<apply>
<minus/>
<ci>u_rv</ci>
<ci>u_pas</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<geq/>
<ci>u_rv</ci>
<ci>u_pas</ci>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<lt/>
<ci>u_rv</ci>
<ci>u_pas</ci>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<ci>v_mi</ci>
<piecewise>
<piece>
<apply>
<times/>
<ci>CV_mi</ci>
<apply>
<root/>
<apply>
<abs/>
<apply>
<minus/>
<ci>u_la</ci>
<ci>u_lv</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<geq/>
<ci>u_la</ci>
<ci>u_lv</ci>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<lt/>
<ci>u_la</ci>
<ci>u_lv</ci>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<ci>v_ao</ci>
<piecewise>
<piece>
<apply>
<times/>
<ci>CV_ao</ci>
<apply>
<root/>
<apply>
<abs/>
<apply>
<minus/>
<ci>u_lv</ci>
<ci>u_sas</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<geq/>
<ci>u_lv</ci>
<ci>u_sas</ci>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<lt/>
<ci>u_lv</ci>
<ci>u_sas</ci>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>q_ra</ci>
</apply>
<apply>
<minus/>
<ci>v_svn</ci>
<ci>v_ti</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>q_rv</ci>
</apply>
<apply>
<minus/>
<ci>v_ti</ci>
<ci>v_pa</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>q_la</ci>
</apply>
<apply>
<minus/>
<ci>v_pvn</ci>
<ci>v_mi</ci>
</apply>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>t</ci>
</bvar>
<ci>q_lv</ci>
</apply>
<apply>
<minus/>
<ci>v_mi</ci>
<ci>v_ao</ci>
</apply>
</apply>
<apply>
<eq/>
<ci>u_ra</ci>
<apply>
<plus/>
<ci>u_ra_ini</ci>
<apply>
<times/>
<ci>E_ra</ci>
<apply>
<minus/>
<ci>q_ra</ci>
<ci>q_ra_ini</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>u_rv</ci>
<apply>
<plus/>
<ci>u_rv_ini</ci>
<apply>
<times/>
<ci>E_rv</ci>
<apply>
<minus/>
<ci>q_rv</ci>
<ci>q_rv_ini</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>u_la</ci>
<apply>
<plus/>
<ci>u_la_ini</ci>
<apply>
<times/>
<ci>E_la</ci>
<apply>
<minus/>
<ci>q_la</ci>
<ci>q_la_ini</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>u_lv</ci>
<apply>
<plus/>
<ci>u_lv_ini</ci>
<apply>
<times/>
<ci>E_lv</ci>
<apply>
<minus/>
<ci>q_lv</ci>
<ci>q_lv_ini</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>et_a</ci>
<piecewise>
<piece>
<apply>
<minus/>
<cn cellml:units="dimensionless">1</cn>
<apply>
<cos/>
<apply>
<divide/>
<apply>
<times/>
<cn cellml:units="dimensionless">2</cn>
<cn cellml:units="radian">3.14159</cn>
<apply>
<plus/>
<apply>
<minus/>
<ci>mt</ci>
<apply>
<times/>
<ci>Tpwb</ci>
<ci>T</ci>
</apply>
</apply>
<ci>T</ci>
</apply>
</apply>
<apply>
<times/>
<ci>Tpww</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<and/>
<apply>
<geq/>
<ci>mt</ci>
<cn cellml:units="second">0</cn>
</apply>
<apply>
<leq/>
<ci>mt</ci>
<apply>
<minus/>
<apply>
<times/>
<apply>
<plus/>
<ci>Tpwb</ci>
<ci>Tpww</ci>
</apply>
<ci>T</ci>
</apply>
<ci>T</ci>
</apply>
</apply>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<and/>
<apply>
<gt/>
<ci>mt</ci>
<apply>
<minus/>
<apply>
<times/>
<apply>
<plus/>
<ci>Tpwb</ci>
<ci>Tpww</ci>
</apply>
<ci>T</ci>
</apply>
<ci>T</ci>
</apply>
</apply>
<apply>
<leq/>
<ci>mt</ci>
<apply>
<times/>
<ci>Tpwb</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</piece>
<piece>
<apply>
<minus/>
<cn cellml:units="dimensionless">1</cn>
<apply>
<cos/>
<apply>
<divide/>
<apply>
<times/>
<cn cellml:units="dimensionless">2</cn>
<cn cellml:units="radian">3.14159</cn>
<apply>
<minus/>
<ci>mt</ci>
<apply>
<times/>
<ci>Tpwb</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
<apply>
<times/>
<ci>Tpww</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<and/>
<apply>
<gt/>
<ci>mt</ci>
<apply>
<times/>
<ci>Tpwb</ci>
<ci>T</ci>
</apply>
</apply>
<apply>
<leq/>
<ci>mt</ci>
<ci>T</ci>
</apply>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<ci>et_v</ci>
<piecewise>
<piece>
<apply>
<minus/>
<cn cellml:units="dimensionless">1</cn>
<apply>
<cos/>
<apply>
<divide/>
<apply>
<times/>
<cn cellml:units="radian">3.14159</cn>
<ci>mt</ci>
</apply>
<apply>
<times/>
<ci>Ts1</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<and/>
<apply>
<geq/>
<ci>mt</ci>
<cn cellml:units="second">0</cn>
</apply>
<apply>
<leq/>
<ci>mt</ci>
<apply>
<times/>
<ci>Ts1</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</piece>
<piece>
<apply>
<plus/>
<cn cellml:units="dimensionless">1</cn>
<apply>
<cos/>
<apply>
<divide/>
<apply>
<times/>
<cn cellml:units="radian">3.14159</cn>
<apply>
<minus/>
<ci>mt</ci>
<apply>
<times/>
<ci>Ts1</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
<apply>
<times/>
<apply>
<minus/>
<ci>Ts2</ci>
<ci>Ts1</ci>
</apply>
<ci>T</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<and/>
<apply>
<gt/>
<ci>mt</ci>
<apply>
<times/>
<ci>Ts1</ci>
<ci>T</ci>
</apply>
</apply>
<apply>
<leq/>
<ci>mt</ci>
<apply>
<times/>
<ci>Ts2</ci>
<ci>T</ci>
</apply>
</apply>
</apply>
</piece>
<piece>
<cn cellml:units="dimensionless">0</cn>
<apply>
<and/>
<apply>
<gt/>
<ci>mt</ci>
<apply>
<times/>
<ci>Ts2</ci>
<ci>T</ci>
</apply>
</apply>
<apply>
<lt/>
<ci>mt</ci>
<ci>T</ci>
</apply>
</apply>
</piece>
</piecewise>
</apply>
<apply>
<eq/>
<ci>E_ra</ci>
<apply>
<plus/>
<ci>E_ra_Min</ci>
<apply>
<divide/>
<apply>
<times/>
<ci>et_a</ci>
<apply>
<minus/>
<ci>E_ra_Max</ci>
<ci>E_ra_Min</ci>
</apply>
</apply>
<cn cellml:units="dimensionless">2</cn>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>E_rv</ci>
<apply>
<plus/>
<ci>E_rv_Min</ci>
<apply>
<divide/>
<apply>
<times/>
<ci>et_v</ci>
<apply>
<minus/>
<ci>E_rv_Max</ci>
<ci>E_rv_Min</ci>
</apply>
</apply>
<cn cellml:units="dimensionless">2</cn>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>E_la</ci>
<apply>
<plus/>
<ci>E_la_Min</ci>
<apply>
<divide/>
<apply>
<times/>
<ci>et_a</ci>
<apply>
<minus/>
<ci>E_la_Max</ci>
<ci>E_la_Min</ci>
</apply>
</apply>
<cn cellml:units="dimensionless">2</cn>
</apply>
</apply>
</apply>
<apply>
<eq/>
<ci>E_lv</ci>
<apply>
<plus/>
<ci>E_lv_Min</ci>
<apply>
<divide/>
<apply>
<times/>
<ci>et_v</ci>
<apply>
<minus/>
<ci>E_lv_Max</ci>
<ci>E_lv_Min</ci>
</apply>
</apply>
<cn cellml:units="dimensionless">2</cn>
</apply>
</apply>
</apply>
</math>
</component>
</model>